package com.song.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2024/1/16
 * @Version 1.0
 **/
@RestController
@RequestMapping("/service-one")
@PropertySource("classpath:application.yml")
public class HelloController {

    @Value("${list}")
    private List<String> list=new ArrayList<>(10);
    @GetMapping("/hi")
    public String sayHi() {
        System.out.println(this.list.size());
        this.list.forEach(System.out::println);
        return "hello,world";
    }
}
